<?php

for ($i = 0; $i < 6; $i++) {
    $process = new \Swoole\Process(function ($process) {
        var_dump('子进程---'.$process->read());
        sleep(1);
        echo posix_getgid().PHP_EOL;
    }, false, true);

    $pid = $process->start();

    $worker[$pid] = $process;

    $process->write('主进程数据');

    var_dump($process->read()); //同步堵塞的
}

